import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
  {
    path: '/',
    name: 'layout',
    component:  () => import('@/Layout/index.vue'),
    children: [
        {
            path: '/Banner',
            name: 'Banner',
            component:  () => import('@/views/Banner/index.vue'),
        },
        {
            path: '/Banner/Save/:id?',
            name: 'BannerSave',
            component:  () => import('@/views/Banner/Save.vue'),
        },
        {
            path: '/ProductCategory',
            name: 'ProductCategory',
            component:  () => import('@/views/Category/index.vue'),
        },
        {
            path: '/ProductCategory/Save/:id?',
            name: 'ProductCategorySave',
            component:  () => import('@/views/Category/Save.vue'),
        },
        {
            path: '/ProductList',
            name: 'ProductList',
            component:  () => import('@/views/ProductList/index.vue'),
        },
        {
            path: '/ProductList/Save/:id?',
            name: 'ProductListSave',
            component:  () => import('@/views/ProductList/Save.vue'),
        },
        {
            path: '/ProductOrder',
            name: 'ProductOrder',
            component:  () => import('@/views/ProductOrder/index.vue'),
        },
        {
            path: '/ProductOrder/Save/:id?',
            name: 'ProductOrderSave',
            component:  () => import('@/views/ProductOrder/Detail.vue'),
        },
        {
            path: '/GiftCategory',
            name: 'GiftCategory',
            component:  () => import('@/views/GiftCategory/index.vue'),
        },
        {
            path: '/GiftCategory/Save/:id?',
            name: 'GiftCategorySave',
            component:  () => import('@/views/GiftCategory/Save.vue'),
        },
        {
            path: '/GiftList',
            name: 'GiftList',
            component:  () => import('@/views/GiftList/index.vue'),
        },
        {
            path: '/GiftList/Save/:id?',
            name: 'GiftListSave',
            component:  () => import('@/views/GiftList/Save.vue'),
        },
        {
            path: '/Member',
            name: 'Member',
            component:  () => import('@/views/Member/index.vue'),
        },
        {
            path: '/Member/Save/:id?',
            name: 'MemberSave',
            component:  () => import('@/views/Member/Save.vue'),
        },
        {
            path: '/Member/Address/:id?',
            name: 'MemberAddress',
            component:  () => import('@/views/Member/Address.vue'),
        },
        {
            path: '/GiftSend',
            name: 'GiftSend',
            component:  () => import('@/views/GiftSend/index.vue'),
        },
        {
            path: '/GiftSend/Save/:id?',
            name: 'GiftSendSave',
            component:  () => import('@/views/GiftSend/Save.vue'),
        },
        {
            path: '/GiftOrder',
            name: 'GiftOrder',
            component:  () => import('@/views/GiftOrder/index.vue'),
        },
    ]
  },
    {
        path: '/login',
        name: 'login',
        component:  () => import('@/views/Login.vue'),
    }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
